package com.hz.basic.service.impl;

import com.hz.basic.dao.MacAddressDao;
import com.hz.common.utils.PageUtils;
import com.hz.common.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.hz.basic.entity.MacAddressEntity;
import com.hz.basic.service.MacAddressService;


@Service("macAddressService")
public class MacAddressServiceImpl extends ServiceImpl<MacAddressDao, MacAddressEntity> implements MacAddressService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<MacAddressEntity> page = this.page(
                new Query<MacAddressEntity>().getPage(params),
                new QueryWrapper<MacAddressEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<MacAddressEntity> getMacListByUid(Long id) {
        MacAddressDao macAddressDao = this.baseMapper;
        return macAddressDao.selectList(new QueryWrapper<MacAddressEntity>().eq("user_id",id).eq("allow",1));
    }

}